{clni_form}
<script type="text/javascript">
{literal}
function toggleSource(id) {
	if (id.checked == false) {
		document.getElementById('medication_source').disabled = false;
	}
	else {
		document.getElementById('medication_source').disabled = true;
	}

	return false;
}
{/literal}
</script>
  <table>

    <tbody>

      <tr>

        <td><label>Name:</label></td>

        <td>{input size="50" name="medication_name"  type="string"}</td>

      </tr>
      <tr>

        <td><label>Dose:</label></td>

        <td>{input size="20" name="medication_dose"  type="string"}</td>

      </tr>
      <tr>

        <td><label>Schedule:</label></td>

        <td>{input size="20" name="medication_schedule"  type="string"}</td>

      </tr>

      <tr>

        <td><label>Quantity:</label></td>

        <td>{input size="20" name="medication_qty"  type="string"}</td>

      </tr>
      <tr>

        <td><label>Date Started:</label></td>

        <td>{input  name="medication_date_began" type="date"}
        </td>

      </tr>
      <tr>

        <td><label>Active:</label></td>
        <td>

		{input type="checkbox" name="medication_active" }
	</td>

      </tr>
 <tr>

        <td><label>Patient Reported:</label></td>
        <td>{input type="checkbox" name="medication_patient_reported" onclick="toggleSource(this);"}</td>

      </tr>
 <tr>

        <td><label>Source:</label></td>
	{if $data->_int_storage->_values.medication_patient_reported eq 1}
	{assign var=disabled value=true}
	{/if}
        <td>{clni_building_list id="medication_source" name="medication_source" blank="true" disabled=$disabled }</td>

      </tr>
 <tr>

        <td><label>Comments:</label></td>

        <td>{input size="50" name="medication_comments" type="string"}</td>

      </tr>
 <tr>

        <td></td>

        <td>{submit}</td>

      </tr>

    </tbody>
  </table>
</form>
